package com.huike.report.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huike.clues.domain.TbClue;
import com.huike.report.result.ReportIndexStatisticsData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * @Description ReportMapper
 * @Author chenjialiang
 * @Date 2023-10-16
 */
@Mapper
public interface IndexMapper extends BaseMapper<TbClue> {
    Integer getCluesNum(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime, @Param("username") String username);

    Integer getBusinessNum(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime, @Param("username") String username);

    Integer getContractNum(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime, @Param("username") String username);

    Double getSalesAmount(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime, @Param("username") String username);

    /**
     * 今日线索
     *
     * @param todayTime
     * @param username
     * @return
     */
    Integer getTodayCluesNum(@Param("todayTime") String todayTime, @Param("username") String username);

    Integer getTodayBusinessNum(@Param("todayTime") String todayTime, @Param("username") String username);

    Integer getTodayContractNum(@Param("todayTime") String todayTime, @Param("username") String username);

    Double getTodaySalesAmount(@Param("todayTime") String todayTime, @Param("username") String username);

    /**
     * 待跟进
     *
     * @param beginCreateTime
     * @param endCreateTime
     * @param username
     * @return
     */
    Integer getTofollowedCluesNum(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime, @Param("username") String username);

    Integer getToallocatedCluesNum(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime, @Param("username") String username);

    Integer getTofollowedBusinessNum(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime, @Param("username") String username);

    Integer getToallocatedBusinessNum(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime, @Param("username") String username);

    List<ReportIndexStatisticsData> getBusinessChangeStatistics(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    Integer getBusinessCount(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    // List<ReportIndexStatisticsData> getSalesStatistic(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime")String endCreateTime);

    /**
     * 每个人的商机数
     * @param beginCreateTime
     * @param endCreateTime
     * @param createBy
     * @return
     */
    // Integer getCountByOne(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime")String endCreateTime, @Param("createBy") String createBy);
}
